﻿using System;
using System.ServiceModel;
using Common;
using DevExpress.Xpo.DB.Helpers;
using DevExpress.Xpo.DB;
using System.ServiceModel.Channels;

namespace Client
{
    /// <summary>
    /// ClientBase for ICachedDataStoreContract
    /// </summary>
    public partial class CachedDataStoreContractClient : ClientBase<ICachedDataStoreContract>, ICachedDataStoreContract
    {

        /// <summary>
        /// Initializes a new instance of the <see cref="CachedDataStoreContractClient"/> class.
        /// </summary>
        public CachedDataStoreContractClient()
        {
        }

        /// <summary>
        /// Initializes a new instance of the <see cref="CachedDataStoreContractClient"/> class.
        /// </summary>
        /// <param name="endpointConfigurationName">Name of the endpoint configuration.</param>
        public CachedDataStoreContractClient(string endpointConfigurationName) :
            base(endpointConfigurationName)
        {
        }

        /// <summary>
        /// Initializes a new instance of the <see cref="CachedDataStoreContractClient"/> class.
        /// </summary>
        /// <param name="endpointConfigurationName">Name of the endpoint configuration.</param>
        /// <param name="remoteAddress">The remote address.</param>
        public CachedDataStoreContractClient(string endpointConfigurationName, string remoteAddress) :
            base(endpointConfigurationName, remoteAddress)
        {
        }

        /// <summary>
        /// Initializes a new instance of the <see cref="CachedDataStoreContractClient"/> class.
        /// </summary>
        /// <param name="endpointConfigurationName">Name of the endpoint configuration.</param>
        /// <param name="remoteAddress">The remote address.</param>
        public CachedDataStoreContractClient(string endpointConfigurationName, EndpointAddress remoteAddress) :
            base(endpointConfigurationName, remoteAddress)
        {
        }

        /// <summary>
        /// Initializes a new instance of the <see cref="CachedDataStoreContractClient"/> class.
        /// </summary>
        /// <param name="binding">The binding.</param>
        /// <param name="remoteAddress">The remote address.</param>
        public CachedDataStoreContractClient(Binding binding, EndpointAddress remoteAddress) :
            base(binding, remoteAddress)
        {
        }

        /// <summary>
        /// Notifies the dirty tables.
        /// </summary>
        /// <param name="cookie">The cookie.</param>
        /// <param name="dirtyTablesNames">The dirty tables names.</param>
        /// <returns></returns>
        public DataCacheResult NotifyDirtyTables(DataCacheCookie cookie, string[] dirtyTablesNames)
        {
            return base.Channel.NotifyDirtyTables(cookie, dirtyTablesNames);
        }

        /// <summary>
        /// Processes the cookie.
        /// </summary>
        /// <param name="cookie">The cookie.</param>
        /// <returns></returns>
        public DataCacheResult ProcessCookie(DataCacheCookie cookie)
        {
            return base.Channel.ProcessCookie(cookie);
        }

        /// <summary>
        /// Gets the auto create option.
        /// </summary>
        /// <returns></returns>
        public AutoCreateOption GetAutoCreateOption()
        {
            return base.Channel.GetAutoCreateOption();
        }

        /// <summary>
        /// Modifies the data cached.
        /// </summary>
        /// <param name="cookie">The cookie.</param>
        /// <param name="dmlStatements">The DML statements.</param>
        /// <returns></returns>
        public DataCacheModificationResult ModifyDataCached(DataCacheCookie cookie, ModificationStatement[] dmlStatements)
        {
            return base.Channel.ModifyDataCached(cookie, dmlStatements);
        }

        /// <summary>
        /// Selects the data cached.
        /// </summary>
        /// <param name="cookie">The cookie.</param>
        /// <param name="selects">The selects.</param>
        /// <returns></returns>
        public DataCacheSelectDataResult SelectDataCached(DataCacheCookie cookie, SelectStatement[] selects)
        {
            return base.Channel.SelectDataCached(cookie, selects);
        }

        /// <summary>
        /// Updates the schema cached.
        /// </summary>
        /// <param name="cookie">The cookie.</param>
        /// <param name="tables">The tables.</param>
        /// <param name="dontCreateIfFirstTableNotExist">if set to <c>true</c> [dont create if first table not exist].</param>
        /// <returns></returns>
        public DataCacheUpdateSchemaResult UpdateSchemaCached(DataCacheCookie cookie, DBTable[] tables, bool dontCreateIfFirstTableNotExist)
        {
            return base.Channel.UpdateSchemaCached(cookie, tables, dontCreateIfFirstTableNotExist);
        }

        /// <summary>
        /// Modifies the data.
        /// </summary>
        /// <param name="dmlStatements">The DML statements.</param>
        /// <returns></returns>
        public ModificationResult ModifyData(ModificationStatement[] dmlStatements)
        {
            return base.Channel.ModifyData(dmlStatements);
        }

        /// <summary>
        /// Selects the data.
        /// </summary>
        /// <param name="selects">The selects.</param>
        /// <returns></returns>
        public SelectedData SelectData(SelectStatement[] selects)
        {
            return base.Channel.SelectData(selects);
        }

        /// <summary>
        /// Updates the schema.
        /// </summary>
        /// <param name="dontCreateIfFirstTableNotExist">if set to <c>true</c> [dont create if first table not exist].</param>
        /// <param name="tables">The tables.</param>
        /// <returns></returns>
        public UpdateSchemaResult UpdateSchema(bool dontCreateIfFirstTableNotExist, DBTable[] tables)
        {
            return base.Channel.UpdateSchema(dontCreateIfFirstTableNotExist, tables);
        }
    }
}
